<!DOCTYPE html>
<html xmlns:ec="http://www.gensee.com/ec">
<head>
<meta charset="utf-8" />
<title>easy cast</title>
<script type="text/javascript" src="sdk/js/ec.js"></script>

<script type="text/javascript">
	//room1
	var room1 = GsEc.room("g1");
	room1.bind("qamsg", appendMsg1);
	function appendMsg1(data){
		alert("room1 接收到："+data);
	}
	function submitQa1(){
		room1.command("qasubmit",{
			from:"user1",
			to:null,
			msg:"hello!"
		});
	}
	function sendMsg1(){
		GsEc._inner_.command("qamsg", "room1的消息123", "g1");
	}
	
	//room2
	var room2 = GsEc.room("g2");
	room2.bind("qamsg", appendMsg2);
	function appendMsg2(data){
		alert("room2 接收到："+data);
	}
	function submitQa2(){
		room2.command("qasubmit",{
			from:"user1",
			to:null,
			msg:"hello!"
		});
	}

	function sendMsg2(){
		var innerAPI = GsEc._inner_;
		innerAPI.command("qamsg", "room2的消息123", "g2");
	}
	//room3
	
	//room4
</script>
</head>
<body>
<div>
三分屏（多直播间）
<hr>
<div>
	<ec:vd roomid="room1" uid="10000" uname="player" authcode="0" group="g1"></ec:vd>
	<ec:doc roomid="room1" uid="10000" uname="tom" authcode="4" group="g1"></ec:doc>
	<ec:qa roomid="room1" uid="10000" uname="tom" authcode="7" group="g7"></ec:qa>
	<input type="button" value="提交问答" onclick="submitQa1()"/><br/>
	<input type="button" value="模拟服务端发送消息" onclick="sendMsg1()"/>
</div>
<hr>
<div>
	<ec:vd roomid="room1" uid="10000" uname="player" authcode="1" group="g2"></ec:vd>
	<ec:doc roomid="room1" uid="10000" uname="tom" authcode="5" group="g2"></ec:doc>
	<ec:qa roomid="room1" uid="10000" uname="tom" authcode="8" group="g2"></ec:qa>
	<input type="button" value="提交问答" onclick="submitQa2()"/><br/>
	<input type="button" value="模拟服务端发送消息" onclick="sendMsg2()"/>
</div>
<hr>
<div>
	<ec:vd roomid="room2" uid="10000" uname="player" authcode="2" group="g3"></ec:vd>
	<ec:doc roomid="room2" uid="10000" uname="tom" authcode="6" group="g3"></ec:doc>
	<ec:qa roomid="room2" uid="10000" uname="tom" authcode="9" group="g3"></ec:qa>
</div>
<hr>
<div>
	<ec:vd roomid="room3" uid="10000" uname="player" authcode="3" group="g4"></ec:vd>
</div>
</div>
</body>
</html>
